home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
eflibpt4.zip
/
DEMO
/
STREAMS
/
FILESTRM.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-07-21
|
1KB
|
30 lines
{ Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
Demonstration; buffered file handling with a data stream
EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED. }
uses EFLIBIO;
const BufferSize = 1000; { Buffer size for the data stream }
TextSegment = 100; { Characters in display buffer }
var MyStream : FileStreamObjectType; Text : array [1..TextSegment] of char;
begin
{ Initialize buffered file stream }
MyStream.Initialize ('..\hamlet.txt', BufferSize);
{ Filename } { Buffer size in bytes }
while not MyStream.IsEnd do begin
{ Read some text from the stream }
MyStream.Read (Text, SizeOf(Text));
{ Write it on the screen }
System.Write (Copy(Text, 1, MyStream.LastTransfer));
{ Number of bytes transferred }
end;
MyStream.Intercept;
end.